package com.lizhongbao.cloud.biz.feign;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * feign配置
 *
 * @Author lizhongbao
 * @Date 2019/12/20
 **/
@Configuration
public class FeignConfig {

    /**
     * feign服务调用，改造GET请求参数
     *
     * @return
     */
    @Bean
    public FeignRequestInterceptor feignRequestInterceptor() {
        return new FeignRequestInterceptor();
    }

    /**
     * 解决Feign开启Hystrix支持时，RequestContextHolder.getRequestAttributes()为null
     *
     * @return
     */
    @Bean
    public FeignHystrixConcurrencyStrategy feignHystrixConcurrencyStrategy() {
        return new FeignHystrixConcurrencyStrategy();
    }

}
